| Total Complexity | 4 |
| Total Lines | 17 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | export interface ReTweetableInterface { |
||
| 12 | |||
| 13 | 5 | export abstract class ReTweetableAbstract implements ReTweetableInterface { |
|
| 14 | 96 | retweetError = ''; |
|
| 15 | |||
| 16 | abstract getRetweetValidations(): Validation[]; |
||
| 17 | |||
| 18 | isReTweetable(): boolean { |
||
| 19 | 26 | const validations = this.getRetweetValidations(); |
|
| 20 | |||
| 21 | 26 | for (const validation of validations) { |
|
| 22 | 127 | if (validation.validate()) { |
|
| 23 | 17 | this.retweetError = validation.message(); |
|
| 24 | 17 | return false; |
|
| 25 | } |
||
| 26 | } |
||
| 27 | |||
| 28 | 9 | return true; |
|
| 29 | } |
||
| 31 |